package com.example.app.Entity;
import static androidx.room.ForeignKey.CASCADE;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.PrimaryKey;
@Entity(tableName = "comments",
        foreignKeys = {
            @ForeignKey(entity = User.class,
                        parentColumns = "id",
                        childColumns = "user_id",
                        onDelete = CASCADE),
            @ForeignKey(entity = Post.class,
                        parentColumns = "id",
                        childColumns = "post_id",
                        onDelete = CASCADE)
        })
public class Comment {
    @PrimaryKey(autoGenerate = true)
    private Long id;
    @ColumnInfo(name = "user_id")
    private Long userId;
    @ColumnInfo(name = "post_id")
    private Long postId;
    private String content;
    @ColumnInfo(name = "comment_time")
    private Long commentTime;
}